import { EndTreatmentReason } from '@CONSTANTS/BleConstants'

interface Props {
  endReasonTreatment?: EndTreatmentReason
  numberOfPauses?: number
  enterNoLoadCounter?: number
  exitNoLoadCounter?: number
  treatmentDuration?: number
  pause1duration?: number
  pause2duration?: number
  pause3duration?: number
  errorCode?: number
  errorCodeParam?: number
  averageIntensity?: number
  maxIntensity?: number
  lastIntensity?: number
  batteryVoltage?: number
  lastDeviceOutputVoltage?: number
  lastDeviceOutputCurrent?: number
  treatmentTimeLeft?: number
  timeStamp?: number
}

export default class LastTreatmentData {
   numberOfPauses: number = 0

   enterNoLoadCounter: number = 0

   exitNoLoadCounter: number = 0

   treatmentDuration: number = 0

   pause1duration: number = 0

   pause2duration: number = 0

   pause3duration: number = 0

   errorCode: number = 0

   errorCodeParam: number = 0

   averageIntensity: number = 0

   maxIntensity: number = 0

   lastIntensity: number = 0

   batteryVoltage: number = 0

   lastDeviceOutputVoltage: number = 0

   lastDeviceOutputCurrent: number = 0

   treatmentTimeLeft: number = 0

   timeStamp: number = 0

   endReasonTreatment: EndTreatmentReason = EndTreatmentReason.NO_TREATMENT

   constructor(props?: Props) {
     this.endReasonTreatment = props?.endReasonTreatment || EndTreatmentReason.NO_TREATMENT
     this.numberOfPauses = props?.numberOfPauses || 0
     this.enterNoLoadCounter = props?.enterNoLoadCounter || 0
     this.exitNoLoadCounter = props?.exitNoLoadCounter || 0
     this.treatmentDuration = props?.treatmentDuration || 0
     this.pause1duration = props?.pause1duration || 0
     this.pause2duration = props?.pause2duration || 0
     this.pause3duration = props?.pause3duration || 0
     this.errorCode = props?.errorCode || 0
     this.errorCodeParam = props?.errorCodeParam || 0
     this.averageIntensity = props?.averageIntensity || 0
     this.maxIntensity = props?.maxIntensity || 0
     this.lastIntensity = props?.lastIntensity || 0
     this.batteryVoltage = props?.batteryVoltage || 0
     this.lastDeviceOutputVoltage = props?.lastDeviceOutputVoltage || 0
     this.lastDeviceOutputCurrent = props?.lastDeviceOutputCurrent || 0
     this.treatmentTimeLeft = props?.treatmentTimeLeft || 0
     this.timeStamp = props?.timeStamp || 0
   }
}
